package com.ylesb.ioc;
/**
 * @title: JavaConfigTest
 * @projectName springdemo
 * @description: TODO
 * @author White
 * @site : [www.ylesb.com]
 * @date 2022/7/710:25
 */

import com.ylesb.ioc.javaconfig.JavaConfig;
import com.ylesb.ioc.javaconfig.SayHello;
import com.ylesb.ioc.service.UserService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.List;

/**
 * @className    : JavaConfigTest
 * @description  : [描述说明该类的功能]  
 * @author       : [XuGuangchao]
 * @site         : [www.ylesb.com]
 * @version      : [v1.0]
 * @createTime   : [2022/7/7 10:25]
 * @updateUser   : [XuGuangchao]
 * @updateTime   : [2022/7/7 10:25]
 * @updateRemark : [描述说明本次修改内容] 
 */

public class JavaConfigTest {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext ctx=new AnnotationConfigApplicationContext(JavaConfig.class);
        SayHello sayHello=ctx.getBean("sh",SayHello.class);
        System.out.println("sayHello= " + sayHello.sayHello("xgc"));
        UserService userService = ctx.getBean(UserService.class);
        List<String> allUsers = userService.getAllUsers();
        System.out.println("allUsers = " + allUsers);


    }
}
